﻿
@using Newtouch.Herp.Infrastructure.Enum
@{
    ViewBag.Title = "配货单验收";
    Layout = "~/Views/Shared/_Form.cshtml";

}

<form id="form1">
    <div class="container" style="padding:0;">
        <div class="tab-content" style="margin-top:10px;padding-right:10px;">
            <div role="tabpanel" class="tab-pane fade in active">
                <table class="form">
                    <tr>
                        <th class="formTitle">配送明细编号：</th>
                        <td class="formValue">
                            <input id="psmxbh" name="psmxbh" type="text" class="form-control" placeholder="" />
                        </td>
                    </tr>
                    <tr>
                        <td class="formTitle"><span class="required">*</span>配送验收类型：</td>
                        <td class="formValue formDdlSelectorTd">
                            <select id="psyslx" name="psyslx" class="form-control required">
                                <option value="">==请选择==</option>
                                <option value="1">预验收</option>
                                <option value="2">实验收</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">本次验收通过数：</th>
                        <td class="formValue">
                            <input id="ystgs" name="ystgs" type="text" class="form-control" placeholder="" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">本次验收不过数：</th>
                        <td class="formValue">
                            <input id="ysbgs" name="ysbgs" type="text" class="form-control" placeholder="" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">验收备注说明：</th>
                        <td class="formValue">
                            <input id="ysbzsm" name="ysbzsm" type="text" class="form-control" placeholder="" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</form>

@*@Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel
{
    ShowKeyList = new int[] {  8 },
    F8Text = "保存",
})*@



<script lang="javascript">
    var psmxbh = $.request("psmxbh");
    var hctbdm = $.request("hctbdm");
    var scph = $.request("scph");
    var psl = $.request("psl");
    $("#psmxbh").val(psmxbh);
    

    ////保存
    //function newtouch_event_f8() {
    //    if (!DataValidate()) {
    //        return;
    //    }
    //    var postData = $("#form1").formSerialize();
    //    postData.hctbdm = hctbdm;
    //    postData.scph = scph;
    //    postData.psl = psl;

    //    $.submitForm({
    //        url: "/Purchase/DeliveryAccept",
    //        param: postData,
    //        success: function () {
    //            $.modalClose();
    //            callback();
    //        }
    //    });
    //}

    //保存
    function SubmitForm() {
        if (!DataValidate()) {
            return;
        }
        var postData = $("#form1").formSerialize();
        postData.hctbdm = hctbdm;
        postData.scph = scph;
        postData.psl = psl;

        $.submitForm({
            url: "/Purchase/DeliveryAccept",
            param: postData,
            success: function () {
                $.modalMsg('验收成功', 'success');
                $.modalClose();
                callback();
            }
        });
    }

    //数据效验
    function DataValidate() {
        if ($("#ystgs").val() === "") {
            $.modalAlert("本次验收通过数必填", 'warning');
            return false;
        }
        if ($("#ysbgs").val() === "") {
            $.modalAlert("本次验收不过数必填", 'warning');
            return false;
        }
        return true;
    }
    

</script>